n = int(input().split()[0])
s = input().split()
X = float(s[0])
Y = float(s[1])

for i in range(1, n):
	tempX = X * 0.2 + Y * 0.6
	tempY = X * 0.8 + Y * 0.4
	X = tempX
	Y = tempY
print(int(X), int(Y), sep = ' ')
